As a technique for preventing overheating of a motor, for example, there is a device as described in Patent Document 1. This device includes an oil temperature sensor for detecting the temperature of oil inside a motor housing, and this device calculates a winding temperature based on oil temperature detected by the oil temperature sensor, and the heat capacity and the thermal resistance of the motor, and detects the motor temperature based on the winding temperature. The torque of the motor is restricted when the detected motor temperature is equal to or higher than a predetermined value.